package com.homework4;

import java.util.HashMap;
import java.util.Map;

public class practice4 {
    static Map<Integer,String> map = new HashMap<Integer, String>();
    static {
        map.put(1, "张三丰");
        map.put(2, "周芷若");
        map.put(3, "汪峰");
        map.put(4, "灭绝师太");
    }
    public static void showAll(){
        for (Map.Entry<Integer,String> en:map.entrySet()) {
            System.out.println("key="+en.getKey()+"， value="+en.getValue());
        }
    }
    public static void main(String[] args) {
        System.out.println("==============================================");
        map.put(5,"李晓红");
        showAll();
        System.out.println("==============================================");
        map.remove(1);
        showAll();
        System.out.println("==============================================");
        map.put(2,"周林");
        showAll();
    }
}

